﻿using Lk.Web.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Lk.Web.ViewComponents
{
    public class PriorityListViewComponent : ViewComponent
    {

        public async Task<IViewComponentResult> InvokeAsync(bool isDone, int maxPriority)
        {

            return View(GetItemsAsync(maxPriority, isDone));
        }

      
        public List<ToDoItem> GetItemsAsync(int maxPriority, bool isDone)
        {

            var list = new List<ToDoItem>();
            for (var i = 0; i < maxPriority; i++)
            {
                list.Add(new ToDoItem() { Id = i, Name = "额呵呵测试组件" });
            }
            return list;
        }
    }

};
